home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Presentations
/
Presentations ’91
/
DAL Files
/
DALtool 4⁄19 (System 6.x)
/
DalDemoInits.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-20
|
2KB
|
66 lines
#include <QuickDraw.h>
#include <MacTypes.h>
#include <WindowMgr.h>
#include <TextEdit.h>
#include <ControlMgr.h>
#include <EventMgr.h>
#include "DalDemo.h"
extern MenuHandle gAppleMenu, gFileMenu, gEditMenu;
extern Rect gDragRect;
extern DialogPtr gLogonDialog;
extern Boolean gDone, gWNEImplemented, gDALActive, gDALMonitor, gDALNewCodeFrag;
extern long gTimer, gCounter;
extern int gDALState;
/*** ToolBoxInit ***/
ToolBoxInit()
{
InitGraf( &thePort);
InitFonts();
FlushEvents(everyEvent,REMOVE_ALL_EVENTS);
InitWindows();
InitMenus();
TEInit();
InitDialogs(NIL);
InitCursor();
}
/***GlobalVarInit***/
void GlobalVarInit()
{
gDone = FALSE;
gWNEImplemented = (NGetTrapAddress( WNE_TRAP_NUM, ToolTrap) !=
NGetTrapAddress( UNIMPL_TRAP_NUM, ToolTrap));
gTimer = TickCount();
gCounter = 0L;
gDALState = 0;
gDALActive = FALSE;
gDALMonitor = FALSE;
gDALNewCodeFrag = FALSE;
}
/*** MenuBarInit ***/
MenuBarInit()
{
Handle myMenuBar;
if ((myMenuBar = GetNewMBar(RSRC_BASE)) == NIL) ErrorHandler(NO_MBAR);
SetMenuBar(myMenuBar);
if ((gAppleMenu = GetMHandle(APPLE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
AddResMenu(gAppleMenu, 'DRVR');
if ((gFileMenu = GetMHandle(FILE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
if ((gEditMenu = GetMHandle(EDIT_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
DrawMenuBar();
}
/*** SetUpDragRect ***/
SetUpDragRect()
{
gDragRect = screenBits.bounds;
gDragRect.left += DRAG_THRESH;
gDragRect.right -= DRAG_THRESH;
gDragRect.bottom -= DRAG_THRESH;
}